<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    *{
        margin: 0;
        padding: 0;
    }
    .box {
        width: 400px;
        height: 400px;
        background-color: blue;
        transform-style: preserve-3d;
        
    }

    .box1 {
        width: 300px;
        height: 300px;
        background-color: red;
        transition: all 2s;
    }

    .box:hover .box1 {
        transform: rotateX(45deg) rotateY(30deg);
    }
</style>

<body>
    <div class="box">
        <div class="box1">

        </div>

    </div>
</body>

</html>